package com.qkjia.demo.controller;

import com.qkjia.demo.service.IDemoService;
import com.qkjia.edu.mvcframework.annotation.QkjiaAutowired;
import com.qkjia.edu.mvcframework.annotation.QkjiaController;
import com.qkjia.edu.mvcframework.annotation.QkjiaRequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zhaoqiankun
 * @since 2021-12-20 1:22
 */
@QkjiaController
@QkjiaRequestMapping("/demo")
public class DemoController {

    @QkjiaAutowired
    private IDemoService demoService;

    /**
     * URL: /demo/query?name=lisi
     *
     * @param request
     * @param response
     * @param name
     * @return
     */
    @QkjiaRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.get(name);
    }
}
